<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let arr = [];
        // arr.length = 6;
        // arr.fill('空');
        // console.log(arr);




        let arr = ['apple','banana','pear'];


        // let keys = arr.keys();

        // let k1 = keys.next();
        // let k2 = keys.next();
        // let k3 = keys.next();
        // let k4 = keys.next();

        // console.log(k1);
        // console.log(k2);
        // console.log(k3);
        // console.log(k4);

        let val = arr.values();

        let k1 = val.next();
        let k2 = val.next();
        let k3 = val.next();
        let k4 = val.next();
        let k5 = val.next();

        console.log(k1);
        console.log(k2);
        console.log(k3);
        console.log(k4);
        console.log(k5);


        // 迭代器对象 - 可迭代 -（可以调用next函数）
        // value [index,val]
        // let entires = arr.entries();
        // console.log(entires);

        // let res =  entires.next();
        // console.log(res.value);

        // let res2 =  entires.next();
        // console.log(res2.value);

        // let res3 =  entires.next();
        // console.log(res3.value);

        // // console.log(res3);

        // let res4 =  entires.next();
        // console.log(res4); //done 完成 true





    </script>
</body>
</html>